from django.db import models

# Create your models here.

class User(models.Model):
    name = models.CharField(max_length=50)
    vip = models.IntegerField(default=1)
class Coupon(models.Model):
    cou = models.CharField(max_length=50)
    user = models.ForeignKey(User,on_delete=models.CASCADE,null=True)
class Product(models.Model):
    good = models.CharField(max_length=50)
    price = models.IntegerField(default=0)
    inventory = models.IntegerField(default=0, verbose_name='库存')
class Cart(models.Model):
    product = models.ForeignKey(Product,on_delete=models.CASCADE)
    user = models.ForeignKey(User,on_delete=models.CASCADE)
    num = models.IntegerField(default=0)












